# -*- coding: utf-8 -*-

import os

import yaml


def get_conf_yaml_data(confName, key=None):
    confPath = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "const_conf",
                            f"{confName}.yaml")
    with open(confPath, "r", encoding="utf-8") as f:
        yamlData = yaml.full_load(f)
    return yamlData if not key else yamlData.get(key)
